package cn.zymall.app.controller.ad;

import cn.zymall.app.service.HomeBillboardsService;
import cn.zymall.common.controller.crud.BaseController;
import cn.zymall.common.model.HomeBillboards;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: mall
 * @description: 广告控制层
 * @author: YueNiao
 * @email: 1486617253@qq.com
 * @create: 2020-08-20 11:38
 **/
@RestController
@RequestMapping("/ad")
public class HomeBillboardsController extends BaseController<HomeBillboardsService, HomeBillboards> {
	@Autowired
	HomeBillboardsService homeBillboardsService;
	/**
	 * 分页全部查询
	 * @param page
	 * @param rows
	 * @return
	 */
	@GetMapping("/findAll")
	public PageInfo<HomeBillboards> findAll(@Param("page") int page, @Param("rows") int rows){
		return homeBillboardsService.findAll( page, rows);
	}

	/**
	 * 模糊查询全部
	 * @param value
	 * @param page
	 * @param rows
	 * @return
	 */
	@GetMapping("/moFindAll")
	public PageInfo<HomeBillboards> moFindAll(@Param("value")String value,@Param("page") int page, @Param("rows") int rows){
		return homeBillboardsService.moFindAll( value,page, rows);
	}

}
